Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

[Pal/Linux-SGX] Add support for Microsoft Azure Attestation to RA-TLS #1793

Closed
wants to merge 1 commit into from

Conversation

dimakuv
Copy link
Contributor

@dimakuv dimakuv commented Sep 3, 2020

Description of the changes

Microsoft Azure Attestation (MAA) is a service that receives Attestation Requests (serialized JSON files containing the SGX quote), verifies SGX quotes against a set of predefined policies, and issues Attestation Tokens containing a signed JSON Web Token (JWT).

This commit adds support for MAA to RA-TLS. RA-TLS already complies with the requirements of RA-TLS cert's public key being SHA256 hashed into an SGX quote's userdata. It is only necessary to construct MAA-specific
JSON content out of the RA-TLS/SGX objects and save it as a file used later by Microsoft Azure specific utility that sends it to MAA service.

Currently, RA-TLS simply generates the file during SGX quote verification if a filename is specified in the
environment variable RA_TLS_MAA_JSON_FILE. It is currently user's responsibility to send this JSON file to the MAA and receive JWT.

For more info, see #1791.

Closes #1791.

Also see the following discussions at https://github.com/Azure-Samples/microsoft-azure-attestation:

How to test this PR?

A simple test is added to Jenkins, but the actual functionality must be tested manually on MS Azure VMs with the help of https://github.com/Azure-Samples/microsoft-azure-attestation.

TODO: I still need to check if it works correctly on MS Azure with intel.sdk.attest.sample/validatequotes.core/ utility.


This change is Reviewable

Microsoft Azure Attestation (MAA) is a service that receives Attestation
Requests (serialized JSON files containing the SGX quote), verifies SGX
quotes against a set of predefined policies, and issues Attestation
Tokens containing a signed JSON Web Token (JWT).

This commit adds support for MAA to RA-TLS. RA-TLS already complies with
the requirements of RA-TLS cert's public key being SHA256 hashed into an
SGX quote's userdata. It is only necessary to construct MAA-specific
JSON content out of the RA-TLS/SGX objects and save it as a file used
later by Microsoft Azure specific utility that sends it to MAA service.

Currently, RA-TLS simply generates the file during SGX quote
verification if a filename is specified in the environment variable
RA_TLS_MAA_JSON_FILE. It is currently user's responsibility to send this
JSON file to the MAA and receive JWT.
Copy link
Contributor

@AI-Memory AI-Memory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 9 files reviewed, all discussions resolved, not enough approvals from maintainers (2 more required), not enough approvals from different teams (1 more required, approved so far: Intel)


Pal/src/host/Linux-SGX/tools/ra-tls/ra_tls.h, line 39 at r1 (raw file):

static const size_t quote_oid_len = sizeof(quote_oid);
#define QUOTE_MAX_SIZE 8192
#define MAA_JSON_FILE_MAX_SIZE (QUOTE_MAX_SIZE * 3)

I think it could avoid to allocate big buffer and check boundary every time by writing to file stream directly.

@graphene-bot
Copy link
Collaborator

Hi!

In #1858 the jenkins configuration was moved from Jenkinsfiles/ to .ci/ directory. I intend to update the configuration in the Jenkins itself, which would have an unfortunate effect that all pull requests, which are not rebased onto commit 0278d69, might fail on Jenkins. This is the case for this PR, among others.

I intend to make this change in about week's time. Please rebase this PR onto said commit (preferably onto current master). You can also just close this PR, if it is no longer relevant.

This is an automated message. If you have questions, please ask woju on slack. Thank you!

@dimakuv
Copy link
Contributor Author

dimakuv commented Oct 18, 2021

Closing for now. We'll need proper MAA integration -- this PR was more of a hack.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Pal/Linux-SGX] Add interoperability with Microsoft Azure Attestation
3 participants